﻿using UnityEngine;

namespace QFramework
{
    public class VectorHelper
    {
        /// <summary>
        /// 计算平面旋转的欧拉角
        /// </summary>
        /// <param name="dir">旋转方向</param>
        public static Quaternion CalcEulerByPlane(Vector3 dir)
        {
            float angle = Vector3.SignedAngle(Vector3.up, dir, Vector3.forward);
            return Quaternion.Euler(0, 0, angle);
        }
    }
}